import { createBrowserRouter } from "react-router-dom"
import Home from "../views/Home"
import Login from "../views/Login"
import { Navigate } from "react-router-dom"
import Cart from "../views/Cart"
const route = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to="/home/index"></Navigate>
  },
  {
    path: "/home",
    element: <Home></Home>,
    children:[
      {
        path:"/home/index",
        element:<div>欢迎来到后台管理系统</div>
      },
      {
        path:"/home/cart",
        element:<Cart></Cart>
      },
    ]
  },
  {
    path: "/login",
    element: <Login></Login>
  }
])

export default route
